<?php
    class Default_Form_ValidateRequirement
    {
        public function validateHotel($hotel)
        {
            $validate = new Zend_Validate_StringLength(1, 300);
            if($validate->isValid($hotel)) {
                return true;
            }
            else {
                return false;
            }
        }
        
        public function validateDate($date)
        {
            $validate = new Zend_Validate_Date('dd-MM-YYYY');
            if($validate->isValid($date)){
                return true;
            }
            else {
                return false;
            }
        }
        
        public function validateQuantity($quantity)
        {
            $validate = new Zend_Validate_StringLength(1, 3);
            if($validate->isValid($quantity)) {
                $validate = new Zend_Validate_Digits();
                if($validate->isValid($quantity)) {
                    return true;
                }
                else {
                    return false;
                }
            }
            else {
                return false;
            }
        }
        
        public function validateFullname($fullname)
        {
            $validate = new Zend_Validate_StringLength(1, 50);
            if($validate->isValid($fullname)) {
                return true;
            }
            else {
                return false;
            }
        }
        
        public function validatePhone($phone)
        {
            $validate = new Zend_Validate_StringLength(1, 20);
            if($validate->isValid($phone)) {
                return true;
            }
            else {
                return false;
            }
        }
        
        public function validateAddress($address)
        {
            $validate = new Zend_Validate_StringLength(1, 500);
            if($validate->isValid($address)) {
                return true;
            }
            else {
                return false;
            }
        }
        
        public function validateEmail($email)
        {
            $validate = new Zend_Validate_StringLength(1, 100);
            if($validate->isValid($email)) {
                $validate = new Zend_Validate_EmailAddress();
                if($validate->isValid($email)) {
                    return true;
                }
                else {
                    return false;
                }
            }
            else {
                return false;
            }
        }
        
        public function validateNickname($nickname)
        {
            $validate = new Zend_Validate_StringLength(1, 50);
            if($validate->isValid($nickname)) {
                return true;
            }
            else {
                return false;
            }
        }
    }
